<template>
	<view class="main">
		<view class="active_tit" style="justify-content: flex-start;">
			<view class="tit">
				<text style="line-height: 6rem;">押品信息</text>
			</view>
			<button :disabled="yrDisabled" @click="yrYp" style="margin: 0 0 0 2rem;" size="mini"
				type="default">获取批量押品</button>
		</view>
		<view style="padding-left: 3rem;width: 100%;" v-if="loanType!=='4'">
			<ActiveForm ref='maximumMortgage' style="width: 100% !important;">
				<radio-group @change="selectmaximumMortgage">
					<text style="font-size: 3rem;">是否有最高额抵押期限内押品：</text>
					<label class="radio" style="font-size: 3rem;">
						<radio value="Y" :checked="maximumMortgage=='Y'" />是
					</label>
					<label class="radio" style="margin-left: 2rem;font-size: 3rem;">
						<radio value="N" :checked="maximumMortgage=='N'" />否
					</label>
				</radio-group>
				<text v-if="maximumMortgage=='Y'"
					style="font-size: 3rem;color: red;margin-left: 2rem;">提示：最高额抵押期限内押品引入后，请不要在押品信息中重复录入！！</text>
			</ActiveForm>
			<block v-if="maximumMortgage=='Y'">
				<view class="active_tit">
					<view class="tit"> 抵押存续期内押品信息说明： </view>
				</view>
				<!-- input -->
				<ActiveForm required ref='maximumMortgageDesc' style="width: 100% !important;">
					<view class="active_input">
						<textarea maxlength="1000" placeholder='最多输入1000字' v-model="maximumMortgageDesc" auto-height
							style="min-height: 20rem;width: 100%;" />
					</view>
				</ActiveForm>
			</block>
		</view>
		<!-- 最高额抵押押品展示 -->
		<block v-if="maximumMortgage=='Y'">
			<ActiveForm ref=''>
				<view class="active_label" style="width: 50rem;"> 最高额抵押合同编号： </view>
				<view class="active_input">
					<input type="text" v-model="contractId" placeholder="合同编号" />
					<button type="pg" @click="getContract()">引入</button>
				</view>
			</ActiveForm>
			<!--  -->
			<block v-for="(item,index) in stdOffsurCollateralContract" :key="index+400">
				<view class="cut">最高额抵押期限内押品{{index+1}}
					<uni-icons class="clear" type="clear"
						@click='stdDel(stdOffsurCollateralContract,item,"stdOffsurCollateralContract")'>
					</uni-icons>
				</view>
				<ActiveForm ref=''>
					<view class="active_label"> 抵押合同编号： </view>
					<view class="active_input">
						<input disabled type="text" v-model="item.contractId" />
					</view>
				</ActiveForm>
				<ActiveForm>
					<view class="active_label"> 借款人名称： </view>
					<view class="active_input">
						<input disabled type="text" v-model="item.applName" />
					</view>
				</ActiveForm>
				<ActiveForm ref='manAssessPrice'>
					<view class="active_label"> 最高额担保金额（元）： </view>
					<view class="active_input">
						<mInput disabled maxlength="16" type="number" v-model="item.maxGurtAmt" />
					</view>
				</ActiveForm>
				<ActiveForm>
					<view class="active_label"> 抵押人名称： </view>
					<view class="active_input">
						<input disabled type="text" v-model="item.pledgorName" />
					</view>
				</ActiveForm>
				<ActiveForm required ref='residue'>
					<view class="active_label"> 拟申请占用金额（元）： </view>
					<view class="active_input">
						<mInput placeholder="请输入" @blur='atmblur($event,item)' type="number"
							v-model="item.applOccupyAmt" />
					</view>
				</ActiveForm>
				<ActiveForm ref='residue'>
					<view class="active_label"> 可用担保金额（元）： </view>
					<view class="active_input">
						<mInput disabled type="number" v-model="item.avaiGurtAmt" />
					</view>
				</ActiveForm>
				<!-- <ActiveForm  ref=''>
					<view class="active_label">
						抵押合同期限：
					</view>
					<view class="active_input">
						<input disabled type="text" v-model="item.termType" />
					</view>
				</ActiveForm> -->
				<ActiveForm ref=''>
					<view class="active_label"> 抵押起始日： </view>
					<view class="active_input">
						<input disabled type="text" v-model="item.contEffDt" />
					</view>
				</ActiveForm>
				<ActiveForm ref=''>
					<view class="active_label"> 抵押到期日： </view>
					<view class="active_input">
						<input disabled type="text" v-model="item.contEndDt" />
					</view>
				</ActiveForm>
				<ActiveForm ref=''>
					<view class="active_label"> 合同状态： </view>
					<view class="active_input">
						<input disabled type="text" value="生效" />
					</view>
				</ActiveForm>
			</block>
		</block>
		<view class="active_tit">
			<view class="tit2"> 资产信息 </view>
			<lb-picker @confirm='ypConfirm' :level='2' ref='ypPicker' mode='multiSelector' :list='ypType'></lb-picker>
			<lb-picker :props='props0' @confirm='confirm0' ref='Picker0' :list='list0'></lb-picker>
			<lb-picker :props='props' @confirm='confirm' ref='Picker1' :list='list'></lb-picker>
			<lb-picker :props='props2' @confirm='confirm2' ref='Picker2' :list='list2'></lb-picker>
		</view>
		<ActiveForm>
			<view class="active_label"> 是否选择已录入抵押物： </view>
			<view class="active_input" style="border: none;">
				<switch :checked="recAssFlag" @change="flagChange" />
			</view>
		</ActiveForm>
		<ActiveForm v-if="recAssFlag">
			<view class="active_label"> 选择已录入抵押物： </view>
			<view class="active_input">
				<jsfun-picker ref="jsfunPicker" style="width: 100%;height: 4rem;" mess="备注：请选择可作为抵押的资产"
					:listArr="entOptionsArr" :defaultArr="recAssets" type="multiple" @click="priceChange1">
					<!-- 自定义页面显示元素 -->
					<view>
						{{recAssets||'请选择'}}
					</view>
				</jsfun-picker>
			</view>
		</ActiveForm>
		<block v-for="(item,index) in stdOffsurCollateral03" :key='index'>
			<view class="cut">押品{{index+1}}
				<uni-icons class="clear" type="clear" @click='stdDel(stdOffsurCollateral03,item,"stdOffsurCollateral")'>
				</uni-icons>
			</view>
			<ActiveForm required ref=''>
				<view class="active_label"> 押品类型： </view>
				<view class="active_input">
					<SelectPicker v-model="item.collateralType" :options="collateralTypeOption" @change='csChange($event,item)' placeholder="请选择" />
					<!-- <input type="text" v-model="item.certificateName" /> -->
				</view>
			</ActiveForm>
			<!-- <ActiveForm required ref=''>
				<view class="active_label">
					房产性质：
				</view>
				<view class="active_input">
					<SelectPicker v-model="item.buildingAttr" :options="buildingAttrOption" placeholder="请选择" />
				</view>
			</ActiveForm> -->
			<ActiveForm required ref=''>
				<view class="active_label"> 产权证号： </view>
				<view class="active_input">
					<input type="text" v-model="item.certificateCode" />
					<button type="pg" @click="wyjy(item,index)">唯一校验</button>
				</view>
			</ActiveForm>
			<ActiveForm required ref=''>
				<view class="active_label"> 押品编号： </view>
				<view class="active_input">
					<input type="text" disabled v-model="item.mortgageSystemId" />
				</view>
			</ActiveForm>
			<ActiveForm required ref=''>
				<view class="active_label"> 是否为第一顺位抵押： </view>
				<view class="active_input">
					<SelectPicker  :disabled="loanType==='4'"  @change='numChange($event,item)' v-model="item.firstMortgage" :options="isOr"
						placeholder="请选择" />
				</view>
			</ActiveForm>
			<ActiveForm required ref='' v-if="loanType!=='4'">
				<view class="active_label"> 抵押次数： </view>
				<view class="active_input">
					<SelectPicker :disabled="item.firstMortgage==='01'" v-model="item.mortagageCount" :options="dyNum"
						placeholder="请选择" />
				</view>
			</ActiveForm>
			<ActiveForm required ref=''>
				<view class="active_label"> 坐落： </view>
				<view class="active_input">
					<input type="text" v-model="item.located" />
				</view>
			</ActiveForm>
			<ActiveForm required ref='mortgageAdd'>
				<view class="active_label"> 资产所在地区： </view>
				<view class="active_input">
					<RegionPicker :value="mortgageAdd(item.mortgageAdd)" :options="region2"
						@change="locChange($event,item,'mortgageAdd')" />
				</view>
			</ActiveForm>
			<ActiveForm required ref='buildingName'>
				<view class="active_label"> 楼盘名称： </view>
				<view class="active_input">
					<input type="text" v-model="item.buildingName" placeholder="关键字查询" />
					<button type="pg" @click="selectXx(index,'buildingName',0)">楼盘查询</button>
				</view>
			</ActiveForm>
			<ActiveForm required ref='buildingNo'>
				<view class="active_label"> 楼栋号（号数）： </view>
				<view class="active_input">
					<input :disabled='zcDisabled' type="text" v-model="item.buildingNo" />
					<button type="pg" @click="selectXx(index,'buildingNo',1)">精准选择</button>
				</view>
			</ActiveForm>
			<ActiveForm required ref='floor'>
				<view class="active_label"> 所在楼层（层数）： </view>
				<view class="active_input">
					<input @input="fcInout(item)" type="number" v-model="item.floor" />
				</view>
			</ActiveForm>
			<ActiveForm required ref='floor'>
				<view class="active_label"> 房号（号数）： </view>
				<view class="active_input">
					<input type="text" :disabled='zcDisabled' v-model="item.roomNo" />
					<button type="pg" @click="selectXx(index,'roomNo',2)">精准选择</button>
				</view>
			</ActiveForm>
			<ActiveForm required ref='allFloor'>
				<view class="active_label"> 总层数（层数）： </view>
				<view class="active_input">
					<input type="number" v-model="item.allFloor" />
				</view>
			</ActiveForm>
			<ActiveForm required ref='area'>
				<view class="active_label"> 面积（平方米）： </view>
				<view class="active_input">
					<mInput @input="fcInout(item)" :thousand='false' v-model="item.area" />
				</view>
			</ActiveForm>
			<ActiveForm required ref='guaranteeBalance'>
				<view class="active_label"> 贷款余额（元）： </view>
				<view class="active_input">
					<mInput :disabled="loanType==='4'" placeholder='此套房产的所有抵押贷款' maxlength="16" type="number" v-model="item.guaranteeBalance" />
				</view>
			</ActiveForm>
			<ActiveForm required ref='autoAssessPrice'>
				<view class="active_label"> 评估价值（线上）： </view>
				<view class="active_input">
					<mInput type="number" :disabled="true" v-model="item.autoAssessPrice" />
					<button type="pg" @click="pg(item,index)">线上评估</button>
				</view>
			</ActiveForm>
			<ActiveForm required ref='manAssessPrice'>
				<view class="active_label"> 评估价值（人工）： </view>
				<view class="active_input">
					<mInput maxlength="16" type="number" @input='assPrice($event,item)' v-model="item.manAssessPrice" />
				</view>
			</ActiveForm>
			
			<ActiveForm required ref='residue'>
				<view class="active_label"> 剩余价值（元）： </view>
				<view class="active_input">
					<mInput type="number" :disabled="true" :value="sy(item)" />
				</view>
			</ActiveForm>
			<ActiveForm required  v-if="loanType==='4'">
				<view class="active_label"> 房屋登记日期： </view>
				<view class="active_input">
					<picker style="width: 100%;" mode="date" :value="item.certificateRegDate"   @change="dateChange($event,item,'certificateRegDate')">
					    <view >{{item.certificateRegDate}}</view>
					</picker>
				</view>
			</ActiveForm>
			<ActiveForm required v-if="loanType==='4'">
				<view class="active_label"> 土地使用权终止日期： </view>
				<view class="active_input">
					<picker style="width: 100%;" mode="date" :value="item.certificateEndDate"   @change="dateChange($event,item,'certificateEndDate')">
					    <view >{{item.certificateEndDate}}</view>
					</picker>
				</view>
			</ActiveForm>
			<ActiveForm required ref='residue'>
				<view class="active_label"> 备注： </view>
				<view class="active_input">
					<input v-model="item.remark" />
				</view>
			</ActiveForm>
			
			<block v-for="(zitem,index) in item.obligeeNameList">
				<view class="cut">抵押人{{index+1}}
					<uni-icons class="clear" type="clear"
						@click='stdDel(item.obligeeNameList,zitem,"stdOffsurCollateralPledgor")'></uni-icons>
				</view>
				<view class="main">
					<ActiveForm required ref=''>
						<view class="active_label"> 抵押人类型： </view>
						<view class="active_input">
							<SelectPicker  :disabled="loanType==='4'" v-model="zitem.pledgorType" :options="pledgorTypeOption" placeholder="请选择"
								@change="pledgorTypeChange(zitem,index)" />
						</view>
					</ActiveForm>
					<ActiveForm required ref=''>
						<view class="active_label"> 抵押人名称： </view>
						<view class="active_input">
							<input type="text" v-model="zitem.pledgorName" />
						</view>
					</ActiveForm>
					<ActiveForm required ref=''>
						<view class="active_label"> 证件类型： </view>
						<view class="active_input">
							<SelectPicker v-model="zitem.idenType" :disabled="true" :options="idenTypeOption"
								placeholder="请选择" />
						</view>
					</ActiveForm>
					<ActiveForm required ref=''>
						<view class="active_label"> 证件号码： </view>
						<view class="active_input">
							<input type="text" @blur="onBlur(zitem,'idenCode',item)"
								@input="cardCheck($event,zitem,'idenCode')" v-model="zitem.idenCode" maxlength="18" />
						</view>
					</ActiveForm>
					<ActiveForm required ref='' v-if="zitem.pledgorType==2">
						<view class="active_label"> 法定代表人： </view>
						<view class="active_input">
							<input type="text" v-model="zitem.frName" maxlength="18" />
						</view>
					</ActiveForm>
					<ActiveForm required ref='' v-if="zitem.pledgorType==2">
						<view class="active_label"> 法定代表人证件号码： </view>
						<view class="active_input">
							<input @blur="onBlur(zitem,'frIdentificationNumber',item)"
								@input="cardCheck($event,zitem,'frIdentificationNumber')" type="text"
								v-model="zitem.frIdentificationNumber" maxlength="18" />
						</view>
					</ActiveForm>
					<ActiveForm required ref=''>
						<view class="active_label"> 联系电话： </view>
						<view class="active_input">
							<input type="number" v-model="zitem.telephone" maxlength="11" />
						</view>
					</ActiveForm>
					<ActiveForm ref=''>
						<view class="active_label"> 邮箱： </view>
						<view class="active_input">
							<input type="text" v-model="zitem.email" />
						</view>
					</ActiveForm>
					<ActiveForm required ref=''>
						<view class="active_label"> 地址省市区： </view>
						<view class="active_input">
							<!-- <input type="text" v-model="zitem.residence" /> -->
							<RegionPicker :value="mortgageAdd(zitem.residence)" :options="region"
								@change="((o)=>{zitem.residence=o.value.toString()})" />
						</view>
					</ActiveForm>
					<ActiveForm required ref=''>
						<view class="active_label"> 详细地址： </view>
						<view class="active_input">
							<input type="text" v-model="zitem.tranAdd" />
						</view>
					</ActiveForm>
					<block v-if="zitem.pledgorType=='1'">
						<ActiveForm required ref=''>
							<view class="active_label"> 婚姻状况： </view>
							<view class="active_input">
								<SelectPicker v-model="zitem.maritalStatusCode" :options="maritalStatusOptions"
									placeholder="请选择" />
							</view>
						</ActiveForm>
						<!-- 逻辑判断  是 不强控   否强控-->
						<ActiveForm required ref='' v-if="zitem.maritalStatusCode==='20'">
							<view class="active_label"> 配偶是否有产权证： </view>
							<view class="active_input">
								<SelectPicker @change='selectPle($event,zitem)' v-model="zitem.maritalBelongPledgor"
									:options="isOr" placeholder="请选择" />
							</view>
						</ActiveForm>
						<ActiveForm required ref=''
							v-if="zitem.maritalStatusCode==='20'&&zitem.maritalBelongPledgor==='02'">
							<view class="active_label"> 配偶是否为抵押人： </view>
							<view class="active_input">
								<SelectPicker v-model="zitem.maritalBelongCollater" :options="isOr" placeholder="请选择" />
							</view>
						</ActiveForm>
						<ActiveForm required ref=''
							v-if="zitem.maritalStatusCode==='20'&&zitem.maritalBelongPledgor==='02'">
							<view class="active_label"> 配偶姓名： </view>
							<view class="active_input">
								<input type="text" v-model="zitem.maritalName" />
							</view>
						</ActiveForm>
						<ActiveForm required ref=''
							v-if="zitem.maritalStatusCode==='20'&&zitem.maritalBelongPledgor==='02'">
							<view class="active_label"> 配偶身份证号： </view>
							<view class="active_input">
								<input @input="cardCheck($event,zitem,'maritalIdCode')" type="text"
									v-model="zitem.maritalIdCode" maxlength="18" />
							</view>
						</ActiveForm>
						<ActiveForm required ref=''
							v-if="zitem.maritalStatusCode==='20'&&zitem.maritalBelongPledgor==='02'">
							<view class="active_label"> 配偶联系电话： </view>
							<view class="active_input">
								<input type="number" v-model="zitem.maritalTelephone" maxlength="11" />
							</view>
						</ActiveForm>
					</block>
				</view>
			</block>
			
			<ActiveForm required ref='mortgageCalculAmount' v-if="loanType=='4'">
				<view class="active_label"> 测算抵押额度： </view>
				<view class="active_input">
					<mInput type="number" :disabled="true" v-model="item.mortgageCalculAmount" />
					<button type="pg" @click="csDyE(item,index)">测算</button>
				</view>
			</ActiveForm>
			<ActiveForm ref='' v-if="item.obligeeNameList.length>1">
				<view class="active_label"> 共有类型： </view>
				<view class="active_input">
					<SelectPicker v-model="item.mutlType" :options="mutlType" placeholder="请选择" />
				</view>
			</ActiveForm>
			<view class="active_tit">
				<view class="tit">
				</view>
				<view class="add" @click="addUserA(index)"> 申请人作为抵押人 </view>
				<view v-if="loanType!=='4'"  class="add" @click="addUserC(index)"> 企业作为抵押人 </view>
				<view class="add" @click="addUser(index)"> 添加抵押人 </view>
			</view>
		</block>
		<view class="active_tit">
			<view class="" style="display: flex;">
				<view class="add" @click="add"> 添加房产类资产 </view>
			</view>
		</view>
		<block >
			<view class="active_tit">
				<view class="tit2"> 其他押品信息 </view>
			</view>
			<block v-for="(item,index) in stdOffsurCollateral04" :key="index+100">
				<view class="cut">其他押品{{index+1}}
					<uni-icons class="clear" type="clear"
						@click='stdDel(stdOffsurCollateral04,item,"stdOffsurCollateral")'>
					</uni-icons>
				</view>
				<ActiveForm required ref=''>
					<view class="active_label"> 押品类型： </view>
					<view class="active_input">
						<input disabled v-model="item.collateralTypeName" type="text" />
						<button type="pg" @click="ypTypeClick(index)">选择</button>
					</view>
				</ActiveForm>
				<ActiveForm required ref=''>
					<view class="active_label"> 识别名称： </view>
					<view class="active_input">
						<picker style="width: 100%;" selector-type='picker' @change="idnfChange($event,item)"
							:range="item.idnfArr">
							<view class="uni-input">{{item.idnfName||'请选择'}}</view>
						</picker>
					</view>
				</ActiveForm>
				<ActiveForm required>
					<view class="active_label"> 押品名称： </view>
					<view class="active_input">
						<input type="text" v-model="item.pledgeType" maxlength="200" />
					</view>
				</ActiveForm>
				<ActiveForm required>
					<view class="active_label"> 唯一标识： </view>
					<view class="active_input">
						<input type="text" :disabled="item.flag" v-model="item.certificateCode" />
						<button type="pg" @click="otherjy(item,index)">唯一校验</button>
					</view>
				</ActiveForm>
				<ActiveForm required ref=''>
					<view class="active_label"> 押品编号： </view>
					<view class="active_input">
						<input type="text" disabled v-model="item.mortgageSystemId" />
					</view>
				</ActiveForm>
				<ActiveForm required ref='manAssessPrice'>
					<view class="active_label"> 评估价值（元）： </view>
					<view class="active_input">
						<mInput :disabled="item.disabled1" maxlength="16" type="number" v-model="item.manAssessPrice" />
					</view>
				</ActiveForm>
				<ActiveForm required ref='guaranteeBalance' v-if="loanType==='4'">
					<view class="active_label"> 贷款余额（元）： </view>
					<view class="active_input">
						<mInput :disabled="loanType==='4'"  placeholder='此套房产的所有抵押贷款' maxlength="16" type="number" v-model="item.guaranteeBalance" />
					</view>
				</ActiveForm>
				<ActiveForm required ref='residue'>
					<view class="active_label"> 剩余价值（元）： </view>
					<view class="active_input">	
						<mInput v-if="loanType==='4'"  type="number" :disabled="true" :value="sy(item)" />
						<mInput v-else type="number" v-model="item.residue" />
					</view>
				</ActiveForm>
				<ActiveForm required ref=''>
					<view class="active_label"> 是否为第一顺位抵押： </view>
					<view class="active_input">
						<SelectPicker  :disabled="loanType==='4'"  @change='numChange($event,item)' v-model="item.firstMortgage" :options="isOr"
							placeholder="请选择" />
					</view>
				</ActiveForm>
				<ActiveForm required ref='' v-if="loanType!=='4'">
					<view class="active_label"> 抵押次数： </view>
					<view class="active_input">
						<SelectPicker :disabled="item.firstMortgage==='01'" v-model="item.mortagageCount"
							:options="dyNum" placeholder="请选择" />
					</view>
				</ActiveForm>
				<ActiveForm required ref='' v-if="loanType!=='4'">
					<view class="active_label"> 单位： </view>
					<view class="active_input">
						<SelectPicker v-model="item.unit" :options="UNIT" placeholder="请选择" />
					</view>
				</ActiveForm>
				<ActiveForm required ref='area'>
					<view class="active_label"> 数量/面积（平方米）： </view>
					<view class="active_input">
						<mInput :disabled="item.disabled2" :thousand='false' type="number" v-model="item.area" />
					</view>
				</ActiveForm>
				<ActiveForm required  v-if="loanType==='4'">
					<view class="active_label"> 房屋登记日期： </view>
					<view class="active_input">
						<picker style="width: 100%;" mode="date" :value="item.certificateRegDate"   @change="dateChange($event,item,'certificateRegDate')">
						    <view >{{item.certificateRegDate}}</view>
						</picker>
					</view>
				</ActiveForm>
				<ActiveForm required v-if="loanType==='4'">
					<view class="active_label"> 土地使用权终止日期： </view>
					<view class="active_input">
						<picker style="width: 100%;" mode="date" :value="item.certificateEndDate"   @change="dateChange($event,item,'certificateEndDate')">
						    <view >{{item.certificateEndDate}}</view>
						</picker>
					</view>
				</ActiveForm>
				<ActiveForm required ref='mortgageAdd' v-if="loanType==='4'">
					<view class="active_label"> 资产所在地区： </view>
					<view class="active_input">
						<RegionPicker :value="mortgageAdd(item.mortgageAdd)" :options="region2"
							@change="locChange($event,item,'mortgageAdd')" />
					</view>
				</ActiveForm>
				<ActiveForm required ref=''>
					<view class="active_label"> 地址/坐落： </view>
					<view class="active_input">
						<input :disabled="item.disabled3" type="text" v-model="item.located" />
					</view>
				</ActiveForm>
				<ActiveForm required style="width: 100% !important;">
					<view class="active_label"> 押品状况描述： </view>
					<view class="active_input">
						<input type="text" v-model="item.pledgeDetail" />
					</view>
				</ActiveForm>
				
				<block v-for="(ditem,index) in item.cardTypeList">
					<view class="cut">证件{{index+1}}
						<uni-icons class="clear" type="clear"
							@click='stdDel(item.cardTypeList,ditem,"stdOffsurCollateral")'></uni-icons>
					</view>
					<ActiveForm required ref=''>
						<view class="active_label"> 证件类型： </view>
						<view class="active_input">
							<input type="text" v-model="ditem.type" />
						</view>
					</ActiveForm>
					<ActiveForm required ref=''>
						<view class="active_label"> 证件号码： </view>
						<view class="active_input">
							<input type="text" v-model="ditem.code" />
						</view>
					</ActiveForm>
				</block>
				<view class="active_tit">
					<view class="add" @click="addType(index)"> 添加押品证件 </view>
				</view>
				<block v-for="(zitem,index) in item.obligeeNameList">
					<view class="cut">抵押人{{index+1}}
						<uni-icons class="clear" type="clear"
							@click='stdDel(item.obligeeNameList,zitem,"stdOffsurCollateralPledgor")'></uni-icons>
					</view>
					<view class="main">
						<ActiveForm required ref=''>
							<view class="active_label"> 抵押人类型： </view>
							<view class="active_input">
								<SelectPicker :disabled="loanType==='4'" v-model="zitem.pledgorType" :options="pledgorTypeOption" placeholder="请选择"
									@change="pledgorTypeChange(zitem,index)" />
							</view>
						</ActiveForm>
						<ActiveForm required ref=''>
							<view class="active_label"> 抵押人名称： </view>
							<view class="active_input">
								<input type="text" v-model="zitem.pledgorName" />
							</view>
						</ActiveForm>
						<ActiveForm required ref=''>
							<view class="active_label"> 证件类型： </view>
							<view class="active_input">
								<SelectPicker v-model="zitem.idenType" :disabled="true" :options="idenTypeOption"
									placeholder="请选择" />
							</view>
						</ActiveForm>
						<ActiveForm required ref=''>
							<view class="active_label"> 证件号码： </view>
							<view class="active_input">
								<input type="text" @blur="onBlur(zitem,'idenCode',item)"
									@input="cardCheck($event,zitem,'idenCode')" v-model="zitem.idenCode"
									maxlength="18" />
							</view>
						</ActiveForm>
						<ActiveForm required ref='' v-if="zitem.pledgorType==2">
							<view class="active_label"> 法定代表人： </view>
							<view class="active_input">
								<input type="text" v-model="zitem.frName" maxlength="18" />
							</view>
						</ActiveForm>
						<ActiveForm required ref='' v-if="zitem.pledgorType==2">
							<view class="active_label"> 法定代表人证件号码： </view>
							<view class="active_input">
								<input @blur="onBlur(zitem,'frIdentificationNumber',item)"
									@input="cardCheck($event,zitem,'frIdentificationNumber')" type="text"
									v-model="zitem.frIdentificationNumber" maxlength="18" />
							</view>
						</ActiveForm>
						<ActiveForm required ref=''>
							<view class="active_label"> 联系电话： </view>
							<view class="active_input">
								<input type="number" v-model="zitem.telephone" maxlength="11" />
							</view>
						</ActiveForm>
						<ActiveForm ref=''>
							<view class="active_label"> 邮箱： </view>
							<view class="active_input">
								<input type="text" v-model="zitem.email" />
							</view>
						</ActiveForm>
						<ActiveForm required ref=''>
							<view class="active_label"> 地址省市区： </view>
							<view class="active_input">
								<!-- <input type="text" v-model="zitem.residence" /> -->
								<RegionPicker :value="mortgageAdd(zitem.residence)" :options="region"
									@change="((o)=>{zitem.residence=o.value.toString()})" />
							</view>
						</ActiveForm>
						<ActiveForm required ref=''>
							<view class="active_label"> 详细地址： </view>
							<view class="active_input">
								<input type="text" v-model="zitem.tranAdd" />
							</view>
						</ActiveForm>
						<block v-if="zitem.pledgorType=='1'">
							<ActiveForm required ref=''>
								<view class="active_label"> 婚姻状况： </view>
								<view class="active_input">
									<SelectPicker v-model="zitem.maritalStatusCode" :options="maritalStatusOptions"
										placeholder="请选择" />
								</view>
							</ActiveForm>
							<!-- 逻辑判断  是 不强控   否强控-->
							<ActiveForm required ref='' v-if="zitem.maritalStatusCode==='20'">
								<view class="active_label"> 配偶是否有产权证： </view>
								<view class="active_input">
									<SelectPicker @change='selectPle($event,zitem)' v-model="zitem.maritalBelongPledgor"
										:options="isOr" placeholder="请选择" />
								</view>
							</ActiveForm>
							<ActiveForm required ref=''
								v-if="zitem.maritalStatusCode==='20'&&zitem.maritalBelongPledgor==='02'">
								<view class="active_label"> 配偶是否为抵押人： </view>
								<view class="active_input">
									<SelectPicker v-model="zitem.maritalBelongCollater" :options="isOr"
										placeholder="请选择" />
								</view>
							</ActiveForm>
							<ActiveForm required ref=''
								v-if="zitem.maritalStatusCode==='20'&&zitem.maritalBelongPledgor==='02'">
								<view class="active_label"> 配偶姓名： </view>
								<view class="active_input">
									<input type="text" v-model="zitem.maritalName" />
								</view>
							</ActiveForm>
							<ActiveForm required ref=''
								v-if="zitem.maritalStatusCode==='20'&&zitem.maritalBelongPledgor==='02'">
								<view class="active_label"> 配偶身份证号： </view>
								<view class="active_input">
									<input type="text" v-model="zitem.maritalIdCode" maxlength="18" />
								</view>
							</ActiveForm>
							<ActiveForm required ref=''
								v-if="zitem.maritalStatusCode==='20'&&zitem.maritalBelongPledgor==='02'">
								<view class="active_label"> 配偶联系电话： </view>
								<view class="active_input">
									<input type="number" v-model="zitem.maritalTelephone" maxlength="11" />
								</view>
							</ActiveForm>
						</block>
					</view>
				</block>
				
				<ActiveForm required ref='mortgageCalculAmount'  v-if="loanType=='4'">
					<view class="active_label"> 测算抵押额度： </view>
					<view class="active_input">
						<mInput type="number" :disabled="true" v-model="item.mortgageCalculAmount" />
						<button type="pg" @click="csDyE(item,index)">测算</button>
					</view>
				</ActiveForm>
				<view class="active_tit">
					<view class="tit">
					</view>
					<view class="add" @click="addUserD(index)"> 申请人作为抵押人 </view>
					<view v-if="loanType!=='4'" class="add" @click="addUserF(index)"> 企业作为抵押人 </view>
					<view class="add" @click="addUser2(index)"> 添加权利人 </view>
				</view>
			</block>
	<!-- 	</block> -->
		<view class="active_tit">
			<view class="" style="display: flex;">
				<view class="add" @click="add2"> 添加其他押品 </view>
			</view>
		</view>
		</block>
	</view>
</template>
<script>
	import pikers from "../../pikers.vue";
	import region from '../areaList.js'
	import SelectPicker from "../../SelectPicker";
	import RegionPicker from "../../RegionPicker";
	import ldSelect from '@/components/ld-select/ld-select.vue'
	import jsfunPicker from '@/components/jsfun-picker/jsfun-picker.vue'
	export default {
		name: 'activeForm',
		data() {
			return {
				loanType: '',
				entOptionsArr: [],
				maritalStatusOptions: [],
				yrDisabled: false,
				mutlType: [{
					label: '请选择',
					value: ''
				}, {
					label: '共同共有',
					value: '0'
				}, {
					label: '按份共有',
					value: '1'
				}],
				region,
				contractId: '', //合同编号
				oldSelect: [],
				province: "",
				city: "",
				county: "",
				index: 1,
				form: {},
				region2: [],
				stdOffsurCollateral03: [],
				stdOffsurCollateral04: [],
				stdOffsurCollateralContract: [],
				buildingAttrOption: [],
				pledgorTypeOption: [],
				idenTypeOption: [],
				pledgorIdenAttOption: [],
				collateralTypeOption: [],
				recAssFlag: false,
				recAssets: '',
				entOptions: [],
				assEntName: [],
				selectIndex: null,
				selectName: '',
				props0: {
					label: 'projectName',
					value: 'projectId'
				},
				props: {
					label: 'buildingName',
					value: 'buildingName'
				},
				props2: {
					label: 'houseName',
					value: 'houseName'
				},
				list0: [],
				list: [],
				list2: [],
				zcDisabled: true,
				isOr: [{
					label: '是',
					value: '01'
				}, {
					label: '否',
					value: '02'
				}],
				UNIT: [],
				ypType: [],
				otherIndex: null,
				idnfArr: [],
				maximumMortgage: '',
				maximumMortgageDesc: '',
				dyNum: [{
					label: "2",
					value: '2'
				}, {
					label: "3",
					value: '3'
				}, {
					label: "4",
					value: '4'
				}, {
					label: "5",
					value: '5'
				}, ]
			}
		},
		props: {
			changeFlag: {
				type: String
			},
		},
		components: {
			SelectPicker,
			RegionPicker,
			ldSelect,
			jsfunPicker,
			pikers
		},
		computed: {
			sy() {
				return function(item) {
					if(this.loanType==='4'){
						item.residue = item.manAssessPrice - item.guaranteeBalance
						
					}else{
						item.residue =item.autoAssessPrice != null&& item.autoAssessPrice != '' && item.autoAssessPrice != '0' ? item.autoAssessPrice -
							item.guaranteeBalance : item.manAssessPrice - item.guaranteeBalance
						
					}
					
					if (item.residue < 0) {
						return 0
					} else {
						return item.residue
					}
				}
			},
			mortgageAdd() {
				return function(val) {
					if (val == '' || val == null) {
						return []
					} else {
						let arr = val.split(",")
						return arr
					}
				}
			}
		},
		watch: {
			stdOffsurCollateralContract: {
				handler: function(res) {
					console.log(res)
					getApp().globalData.stdOffsurCollateralContract = res
				},
				deep: true
			},
			maximumMortgageDesc: {
				handler: function(res) {
					//console.log(res)
					getApp().globalData.stdOffsurBaiscInfo.maximumMortgageDesc = res
				},
				deep: true
			},
			stdOffsurCollateral04: {
				handler: function(res) {
					//console.warn('stdOffsurCollateral03组件数据变化',res)
					getApp().globalData.stdOffsurCollateral04 = res
				},
				deep: true
			},
			stdOffsurCollateral03: {
				handler: function(res) {
					//console.warn('stdOffsurCollateral03组件数据变化',res)
					getApp().globalData.stdOffsurCollateral03 = res
				},
				deep: true
			},
			recAssFlag: {
				handler: function(res) {
					if (!getApp().globalData.stdOffsurBaiscInfo.recAssFlag) {
						getApp().globalData.stdOffsurBaiscInfo.recAssFlag = false
					}
					if (!res) {
						for (let m = 0; m < this.entOptionsArr.length; m++) {
							for (let k = 0; k < this.stdOffsurCollateral03.length; k++) {
								let name = this.entOptionsArr[m].split('】')
								let name2 = this.stdOffsurCollateral03[k].buildingName + this.stdOffsurCollateral03[k]
									.roomNo
								if (name == name2) {
									this.stdOffsurCollateral03.remove(this.stdOffsurCollateral03[k])
								}
							}
						}
					}
				},
				deep: true
			},
			form: {
				handler: function(res) {
					//console.warn('质押物组件数据变化',res)
					getApp().globalData.stdOffsurCollateral.zyws = res
				},
				deep: true
			},
			changeFlag: {
				handler: function(res) {
					let arr1 = getApp().globalData.stdOffsurSceneLoanRelation
					let arr2 = getApp().globalData.stdOffsurCoBorrowerBasic
					let col1 = []
					let col2 = []
					for (let j = 0; j < arr1.length; j++) {
						col1.push.apply(col1, arr1[j].stdOffsurCollateral);
					}
					for (let k = 0; k < arr2.length; k++) {
						col2.push.apply(col2, arr2[k].stdOffsurCollateral);
					}
					let optionArr = JSON.parse(JSON.stringify([...getApp().globalData.stdOffsurCollateral01, ...
					getApp().globalData.stdOffsurCollateral02, ...col1, ...col2]))
					//console.log(optionArr)
					let entOptions = []
					for (let i = 0; i < optionArr.length; i++) {
						let nameCode = ''
						let index = i + 1
						nameCode = '【资产' + index + '】' + optionArr[i].buildingName + optionArr[i].roomNo
						entOptions.push(nameCode)
					}
					this.entOptionsArr = entOptions
					setTimeout(() => {
						this.$refs.jsfunPicker.initValue()
					}, 300)
				},
				deep: true
			},
		},
		mounted() {
			//获取返显数据
			setTimeout(() => {
				this.loanType = getApp().globalData.stdOffsurBaiscInfo.loanType
				this.region2 = getApp().globalData.FxtData
				console.log('房讯通地址：', this.region2)
				//数据反显
				// ========码表数据
				this.maritalStatusOptions = getApp().globalData.optType.MARITAL
				this.buildingAttrOption = getApp().globalData.optType.BUL_ATT
				
				if(this.loanType==='4'){
					this.pledgorTypeOption = [{label:'自然人',value:'1'}]
				}else{
					this.pledgorTypeOption = getApp().globalData.optType.SUBJECT
				}
				this.idenTypeOption = getApp().globalData.optType.PLEDGOR_IDEN
				this.pledgorIdenAttOption = getApp().globalData.optType.PLEDGOR_IDEN_ATT
				this.collateralTypeOption = getApp().globalData.optType.COLLTERAL_CATEGORY
				this.UNIT = getApp().globalData.optType.UNIT
				
				if(this.loanType==='4'){
					this.ypType =getApp().globalData.ypKdType
				}else{
					this.ypType = getApp().globalData.ypType
				}
				
				//===========页面数据反显
				this.stdOffsurCollateralContract = getApp().globalData.stdOffsurCollateralContract || []
				this.maximumMortgageDesc = getApp().globalData.stdOffsurBaiscInfo.maximumMortgageDesc
				this.maximumMortgage = getApp().globalData.stdOffsurBaiscInfo.maximumMortgage
				this.form = getApp().globalData.stdOffsurCollateral.zyws != null ? getApp().globalData
					.stdOffsurCollateral.zyws : {}
				//this.form = getApp().globalData.stdOffsurCollateral.zyws
				if (!getApp().globalData.stdOffsurBaiscInfo.recAssFlag) {
					//this.form.recAssFlag = false 
					this.recAssFlag = false
				}
				if (getApp().globalData.stdOffsurBaiscInfo.recAssFlag == "true") {
					this.recAssFlag = true
					//this.form.recAssFlag = true 
				}
				if (getApp().globalData.stdOffsurBaiscInfo.recAssFlag == "false") {
					this.recAssFlag = false
					//this.form.recAssFlag = false 
				}
				if (!getApp().globalData.stdOffsurBaiscInfo.recAssets) {
					//this.form.recAssets = ''
					this.recAssets = ''
				} else {
					this.recAssets = getApp().globalData.stdOffsurBaiscInfo.recAssets
				}
				let arr = getApp().globalData.stdOffsurCollateral.dyws
				if (arr != null) {
					for (let i = 0; i < arr.length; i++) {
						if (arr[i].busiType == '03') {
							if (arr[i].certificateIdent == 'N') {
								setTimeout(() => {
									this.stdOffsurCollateral04.push(arr[i])
								}, 30)
							} else {
								setTimeout(() => {
									this.stdOffsurCollateral03.push(arr[i])
								}, 30)
							}
						}
					}
				}
			}, getApp().globalData.timeout)
		},
		methods: {
			//测算监听,数据变动置空
			csChange(e,item){
				item.mortgageCalculAmount = ''
			},
			// 日期选择处理
			dateChange(e,item,prop){
				console.log(e,item,prop)
				item[prop] = e.target.value
				this.csChange(e,item)
			},
			// 地址选择
			locChange(e,item,prop){
				console.log(e,item,prop)
				item[prop] = e.value.toString()
				this.csChange(e,item)
			},
			assPrice(e,item){
				console.log(e,item.autoAssessPrice)
				if(this.loanType==='4'){
					this.csChange(e,item)
					if(!item.autoAssessPrice){
						uni.showToast({
							icon: 'none',
							title: '请先线上评估',
							duration: 2500
						})
						return false
					}
					if(Number(item.autoAssessPrice)!==0){
						if(Number(e)>Number(item.autoAssessPrice) ){
							item.manAssessPrice = ''
							uni.showToast({
								icon: 'none',
								title: '线下评估必须小于线上评估',
								duration: 2500
							})
						}
						
					}
						
				}
				
			},
			csDyE(item,index){
			
				if(!item.mortgageSystemId||!item.certificateRegDate||!item.certificateEndDate||!item.busiType||!item.mortgageAdd||!item.manAssessPrice||!item.collateralType){
					uni.showToast({
						icon: 'none',
						title: '请补全押品信息再计算',
						duration: 2500
					})
					return false
				}
				let arr = item.obligeeNameList
				for(let i=0;i<arr.length;i++){
					if(!arr[i].idenCode){
						uni.showToast({
							icon: 'none',
							title: '请补全抵押人信息再计算',
							duration: 2500
						})
						return false
					}
				}
				let param = {
					reqId:getApp().globalData.reqId,
					businessId:getApp().globalData.stdOffsurBaiscInfo.businessId,
					certificateRegDate:item.certificateRegDate,
					certificateEndDate:item.certificateEndDate,
					busiType:item.busiType,
					mortgageAdd:item.mortgageAdd,
					obligeeNameList:item.obligeeNameList,
					manAssessPrice:item.manAssessPrice,
					collateralType:item.collateralType,
					mortgageSystemId:item.mortgageSystemId
				}
				this.sendRequest({
					url: 'offsur/collateralEdCalculate',
					method: 'post',
					hideLoading: true,
					data: param,
					complete: (res) => {
						if(res.code==='200'){
							item.mortgageCalculAmount = res.data
						}else{
							uni.showToast({
								icon: 'none',
								title: res.message,
								duration: 2500
							})
						}
						
					}
				})
				
				
			},
			numChange(e, item) {
				if (e === '01') {
					item.mortagageCount = ''
					//offsur/getTotalMortgageAmountByReqId
				}
			},
			selectPle(e, item) {
				console.log(e)
				if (e === '01') {
					uni.showModal({
						title: '提示',
						content: '请确认已将配偶录入为抵押人',
						showCancel: false,
						success: function(res) {
							if (res.confirm) {
								item.maritalBelongCollater = ''
								item.maritalName = ''
								item.maritalIdCode = ''
								item.maritalTelephone = ''
								console.log('用户点击确定', item);
							} else if (res.cancel) {
								console.log('用户点击取消');
							}
						}
					});
				}
			},
			addType(index) {
				this.stdOffsurCollateral04[index].cardTypeList.push({
					type: '',
					code: ''
				})
			},
			yrYp2() {
				//mortgageSystemId  押品编号校验
				let oldData = JSON.parse(JSON.stringify([...this.stdOffsurCollateral03, ...this.stdOffsurCollateral04]))
				let arr = [{
					mortgageSystemId: '1'
				}, {
					mortgageSystemId: '2'
				}, {
					mortgageSystemId: '3'
				}, {
					mortgageSystemId: '4'
				}]
				let newList = []; //保存遍历时要留下的项
				for (let i = 0; i < arr.length; i++) {
					let item = arr[i]
					let isExist = false;
					for (let j = 0; j < oldData.length; j++) {
						var id = oldData[j].mortgageSystemId;
						if (item.mortgageSystemId == id) {
							isExist = true;
							break;
						}
					}
					if (!isExist) {
						newList.push(item);
					}
				}
				console.log(newList)
				// uni.showLoading({
				// 	mask: true,
				// })
				for (let i = 0; i < newList.length; i++) {
					newList[i].obligeeNameList = []
					setTimeout(() => {
						this.stdOffsurCollateral03.push(newList[i])
					}, 30)
					// if(i===newList.length-1){
					// 	uni.hideLoading()
					// }
				}
			},
			yrYp() { //多押品引入
				this.yrDisabled = true
				setTimeout(() => {
					this.yrDisabled = false
				}, 3000)
				this.sendRequest({
					url: 'offsur/batchQueryCollateralInfo',
					method: 'post',
					hideLoading: false,
					data: {
						reqId: getApp().globalData.reqId,
					},
					complete: (res) => {
						if (res.code == '200') {
							if (res.data.length === 0) {
								uni.showToast({
									icon: 'none',
									title: '暂无推送至本业务的押品信息，请前往押品管理系统核实或绑定押品。',
									duration: 2500
								})
								return false
							}
							//mortgageSystemId  押品编号校验
							let oldData = JSON.parse(JSON.stringify([...this.stdOffsurCollateral03, ...this
								.stdOffsurCollateral04
							]))
							let arr = res.data
							let newList = []; //保存遍历时要留下的项
							for (let i = 0; i < arr.length; i++) {
								let item = arr[i]
								let isExist = false;
								for (let j = 0; j < oldData.length; j++) {
									var id = oldData[j].mortgageSystemId;
									if (item.mortgageSystemId == id) {
										isExist = true;
										break;
									}
								}
								if (!isExist) {
									newList.push(item);
								}
							}
							console.log(newList)
							if (newList.length > 1) {
								uni.showLoading({
									mask: true,
								})
							}
							for (let i = 0; i < newList.length; i++) {
								if(this.loanType==='4'){
									newList[i].firstMortgage = '01'
									newList[i].guaranteeBalance = '0'
									newList[i].obligeeNameList = [{
										idenCode: '', //证件号码
										idenType: '110000', //证件类型
										pledgorIdenAtt: '', //抵押人身份属性
										pledgorName: '', //抵押人名称
										pledgorType: '1', //抵押人类型
										postCode: '', //邮政编码
										residence: '', //住所
										telephone: '', //联系电话
										tranAdd: '' //通讯地址
									}]
								}
								if (newList[i].busiType == '03') {
									if (newList[i].certificateIdent == 'N') {
										setTimeout(() => {
											this.stdOffsurCollateral04.push(newList[i])
										}, 30)
									} else {
										setTimeout(() => {
											this.stdOffsurCollateral03.push(newList[i])
										}, 30)
									}
								}
								if (i === newList.length - 1) {
									uni.hideLoading()
								}
							}
						} else {
							uni.showToast({
								icon: 'none',
								title: res.message,
								duration: 2500
							})
						}
					}
				})
			},
			atmblur(e, item) {
				console.log(e, item.avaiGurtAmt) //需求变更，正常1申请进行校验 最高maxGurtAmt
				//最新需求
				if (Number(e) > Number(item.maxGurtAmt)) {
					uni.showToast({
						icon: 'none',
						title: '拟申请占用金额不能高于引入的最高额担保合同金额！',
						duration: 2500
					})
					item.applOccupyAmt = ''
					return false
				}
				//拟占用金额不能为0
				if (e === '0') {
					uni.showToast({
						icon: 'none',
						title: '拟申请占用金额不能为0！',
						duration: 2500
					})
					item.applOccupyAmt = ''
					return false
				}
			},
			//查询合同编号
			getContract() {
				if (this.contractId == '') {
					uni.showToast({
						icon: 'none',
						title: '请先输入合同编号！',
						duration: 2000
					})
					return false
				}
				//this.stdOffsurCollateralContract.push({applOccupyAmt:''})
				this.sendRequest({
					url: 'loanBaseInfo/getContractInfo',
					method: 'post',
					hideLoading: false,
					data: {
						reqId: getApp().globalData.reqId,
						contractId: this.contractId
					},
					complete: (res) => {
						if (res.code == '200') {
							let flag = this.stdOffsurCollateralContract.find(item => item.contractId == this
								.contractId)
							if (!flag) {
								this.stdOffsurCollateralContract.push(res.data)
							} else {
								uni.showToast({
									icon: 'none',
									title: '合同已存在！',
									duration: 2500
								})
							}
						} else {
							uni.showToast({
								icon: 'none',
								title: res.message,
								duration: 2500
							})
						}
					}
				})
			},
			selectmaximumMortgage(e) {
				this.maximumMortgage = e.detail.value
				getApp().globalData.stdOffsurBaiscInfo.maximumMortgage = e.detail.value
			},
			fcInout(item) {
				console.log(item)
				item.autoAssessPrice = ''
			},
			idnfChange(e, item) {
				console.log(e.detail.value, item)
				item.idnfName = item.idnfArr[e.detail.value]
			},
			ypConfirm(e) {
				console.log(e)
				this.stdOffsurCollateral04[this.otherIndex].mortgageCalculAmount = ''
				this.stdOffsurCollateral04[this.otherIndex].idnfName = ''
				this.stdOffsurCollateral04[this.otherIndex].idnfArr = e.item[1].names
				this.stdOffsurCollateral04[this.otherIndex].collateralTypeName = e.item[1].label
				this.stdOffsurCollateral04[this.otherIndex].collateralType = e.value[1]
				this.stdOffsurCollateral04[this.otherIndex].ypType = e.item[1].key
				let collateralType = e.value[1]
				if (collateralType == 'D210101' || collateralType == 'D240101' || collateralType == 'E290101' ||
					collateralType == 'E280101' || collateralType == 'A070102' || collateralType == 'A070101' ||
					collateralType == 'B080101' || collateralType == 'B080102' || collateralType == 'B130101' ||
					collateralType == 'B100401') {
					this.stdOffsurCollateral04[this.otherIndex].flag = true
					this.stdOffsurCollateral04[this.otherIndex].certificateCode = ''
				} else {
					this.stdOffsurCollateral04[this.otherIndex].flag = false
				}
				//item.collateralType
			},
			ypTypeClick(e) {
				console.log(e)
				this.otherIndex = e
				this.$refs.ypPicker.show() // 显示
			},
			selectXx(index, name, type) {
				this.selectIndex = index
				this.selectName = name
				//接口评估房产
				let item = this.stdOffsurCollateral03[index]
				let arr = item.mortgageAdd.split(',')
				//console.log(arr)
				if (type == 0) {
					if (item.mortgageAdd == '') {
						uni.showToast({
							icon: 'none',
							title: '请先选择资产所在地',
							duration: 2000
						})
						return false
					}
					if (item.buildingName == '') {
						uni.showToast({
							icon: 'none',
							title: '请先输入楼盘关键字',
							duration: 2000
						})
						return false
					}
					let data = {
						"areaId": arr[2],
						"cityId": arr[1],
						"key": item.buildingName
					}
					this.sendRequest({
						url: 'fxt/project',
						method: 'post',
						hideLoading: true,
						data: data,
						complete: (res) => {
							if (res.code == '0') {
								this.list0 = res.body
								this.$refs.Picker0.show() // 显示
							} else {
								//this.zcDisabled = false
								uni.showToast({
									icon: 'none',
									title: '楼盘获取失败，请重试',
									duration: 2000
								})
							}
						}
					})
				} else if (type == 1) {
					if (item.mortgageAdd == '') {
						uni.showToast({
							icon: 'none',
							title: '请先选择资产所在地',
							duration: 2000
						})
						return false
					}
					if (item.buildingName == '') {
						uni.showToast({
							icon: 'none',
							title: '请先输入楼盘名称',
							duration: 2000
						})
						return false
					}
					let data = {
						"areaId": arr[2],
						"buildingName": item.buildingNo,
						"cityId": arr[1],
						"floor": item.floor,
						"houseName": item.roomNo,
						"projectName": item.buildingName,
						"projectId": item.projectId
					}
					this.sendRequest({
						url: 'fxt/building',
						method: 'post',
						hideLoading: true,
						data: data,
						complete: (res) => {
							if (res.code == '0') {
								this.list = res.body
								this.$refs.Picker1.show() // 显示
							} else {
								//this.zcDisabled = false
								uni.showToast({
									icon: 'none',
									title: '楼栋号获取失败,请重试',
									duration: 2000
								})
							}
						}
					})
				} else {
					if (!item.buildingId) {
						uni.showToast({
							icon: 'none',
							title: '请精准选择获取楼栋号',
							duration: 2000
						})
						return false
					}
					if (!item.floor) {
						uni.showToast({
							icon: 'none',
							title: '请输入楼层',
							duration: 2000
						})
						return false
					}
					let data = {
						"cityId": arr[1],
						"buildingId": item.buildingId,
						"floor": item.floor,
						"areaId": arr[2],
						"buildingName": item.buildingNo,
					}
					this.sendRequest({
						url: 'fxt/house',
						method: 'post',
						hideLoading: true,
						data: data,
						complete: (res) => {
							if (res.code == '0') {
								this.list2 = res.body
								this.$refs.Picker2.show() // 显示
							} else {
								//this.zcDisabled = false
								uni.showToast({
									icon: 'none',
									title: '房号获取失败',
									duration: 2000
								})
							}
						}
					})
				}
				//this.$refs.picker.hide() // 隐藏
			},
			confirm0(e) {
				console.log(e)
				this.stdOffsurCollateral03[this.selectIndex][this.selectName] = e.item.projectName
				this.stdOffsurCollateral03[this.selectIndex].projectId = e.item.projectId
			},
			confirm(e) {
				this.stdOffsurCollateral03[this.selectIndex].buildingId = this.list[e.index].buildingId
				this.stdOffsurCollateral03[this.selectIndex].projectId = this.list[e.index].projectId
				this.stdOffsurCollateral03[this.selectIndex][this.selectName] = e.value
			},
			confirm2(e) {
				this.stdOffsurCollateral03[this.selectIndex].houseId = this.list2[e.index].houseId
				this.stdOffsurCollateral03[this.selectIndex][this.selectName] = e.value
			},
			priceChange1(e) {
				try {
					for (let m = 0; m < this.entOptionsArr.length; m++) {
						for (let k = 0; k < this.stdOffsurCollateral03.length; k++) {
							let name = this.entOptionsArr[m].split('】')
							let name2 = this.stdOffsurCollateral03[k].buildingName + this.stdOffsurCollateral03[k].roomNo
							// console.log(name,name2)
							if (name[1] == name2) {
								this.stdOffsurCollateral03.remove(this.stdOffsurCollateral03[k])
							}
						}
					}
				} catch (e) {
					//TODO handle the exception
				} finally {
					let arr1 = getApp().globalData.stdOffsurSceneLoanRelation
					let arr2 = getApp().globalData.stdOffsurCoBorrowerBasic
					let col1 = []
					let col2 = []
					for (let j = 0; j < arr1.length; j++) {
						col1.push.apply(col1, arr1[j].stdOffsurCollateral);
					}
					for (let k = 0; k < arr2.length; k++) {
						col2.push.apply(col2, arr2[k].stdOffsurCollateral);
					}
					let arr = e.textStr.split(",")
					let optionArr = JSON.parse(JSON.stringify([...getApp().globalData.stdOffsurCollateral01, ...getApp()
						.globalData.stdOffsurCollateral02, ...col1, ...col2
					]))
					for (let i = 0; i < arr.length; i++) {
						for (let j = 0; j < optionArr.length; j++) {
							let index = j + 1
							let nameCode = "【资产" + index + "】" + optionArr[j].buildingName + optionArr[j].roomNo
							if (arr[i] == nameCode) {
								optionArr[j].busiType = '03'
								if(this.loanType==='4'){
									optionArr[j].firstMortgage = '01'
									optionArr[j].guaranteeBalance = '0'
									optionArr[j].obligeeNameList = [{
										idenCode: '', //证件号码
										idenType: '110000', //证件类型
										pledgorIdenAtt: '', //抵押人身份属性
										pledgorName: '', //抵押人名称
										pledgorType: '1', //抵押人类型
										postCode: '', //邮政编码
										residence: '', //住所
										telephone: '', //联系电话
										tranAdd: '' //通讯地址
									}]
								}
								this.stdOffsurCollateral03.push(optionArr[j])
							}
						}
					}
					//this.form.recAssets = e.textStr
					this.recAssets = e.textStr
					getApp().globalData.stdOffsurBaiscInfo.recAssets = e.textStr
				}
			},
			flagChange(e) {
				this.recAssFlag = e.detail.value
				//this.form.recAssFlag = e.detail.value
				getApp().globalData.stdOffsurBaiscInfo.recAssFlag = e.detail.value
			},
			entChange(e) {},
			cardCheck(e, item, name) {
				setTimeout(() => {
					item[name] = e.target.value.replace(/[^\a-\z\A-\Z0-9]/g, '')
				}, 50)
			},
			onBlur(item, name,Fitem) {
				if(this.loanType==='4'){
					Fitem.mortgageCalculAmount = ''
				}
				if (item.pledgorType != 2) {
					if (!this.checkIDCard(item[name])) {
						item[name] = ''
						uni.showToast({
							icon: 'none',
							title: '身份证号码无效,请重新输入！',
							duration: 2500
						});
					}
				} else {
					if (name == 'frIdentificationNumber') {
						if (!this.checkIDCard(item[name])) {
							item[name] = ''
							uni.showToast({
								icon: 'none',
								title: '身份证号码无效,请重新输入！',
								duration: 2500
							});
						}
					}
				}
			},
			otherjy(item, index) {
				this.stdOffsurCollateral04[index].disabled1 = false
				this.stdOffsurCollateral04[index].disabled2 = false
				this.stdOffsurCollateral04[index].disabled3 = false
				console.log(item)
				if (!item.collateralType) {
					uni.showToast({
						icon: 'none',
						title: '请选择押品类型和识别名称',
						duration: 2000
					})
					return false
				}
				if (!item.pledgeType) {
					uni.showToast({
						icon: 'none',
						title: '请输入押品名称！',
						duration: 2000
					})
					return false
				}
				if (item.collateralType == 'D210101' || item.collateralType == 'D240101' || item.collateralType ==
					'E290101' || item.collateralType == 'E280101' || item.collateralType == 'A070102' || item
					.collateralType == 'A070101' || item.collateralType == 'B080101' || item.collateralType == 'B080102' ||
					item.collateralType == 'B130101' || item.collateralType == 'B100401') {} else {
					if (!item.certificateCode) {
						uni.showToast({
							icon: 'none',
							title: '请输入唯一标识！',
							duration: 2000
						})
						return false
					}
				}
				//
				let data = {
					"idnfNo": item.certificateCode,
					idnfName: item.idnfName,
					"collatType": item.collateralType,
					"collatName": item.pledgeType,
					reqId: getApp().globalData.reqId
				}
				this.sendRequest({
					url: 'loanBaseInfo/collateralIsUniqueOthers',
					method: 'post',
					hideLoading: true,
					data: data,
					complete: (res) => {
						if (res.code == '200') {
							if (res.data.EXST_STATUS == '0') {
								uni.showToast({
									icon: 'none',
									title: '验证通过',
									duration: 2000
								})
							} else {
								uni.showToast({
									icon: 'none',
									title: '押品系统已存在该押品，请注意核对！',
									duration: 2000
								})
							}
							this.stdOffsurCollateral04[index].mortgageSystemId = res.data.COLL_REF
							//反显数据
							//评估价值
							this.stdOffsurCollateral04[index].manAssessPrice = res.data.OWNBNK_AKNLG_WRTH_AMT
							if (!!res.data.OWNBNK_AKNLG_WRTH_AMT) {
								this.stdOffsurCollateral04[index].disabled1 = true
							}
							//房屋坐落 HS_ADDR
							this.stdOffsurCollateral04[index].located = res.data.HS_ADDR
							if (!!res.data.HS_ADDR) {
								this.stdOffsurCollateral04[index].disabled3 = true
							}
							//面积CONS_AREA_VAL
							this.stdOffsurCollateral04[index].area = res.data.CONS_AREA_VAL
							if (!!res.data.CONS_AREA_VAL) {
								this.stdOffsurCollateral04[index].disabled2 = true
							}
							// } else {
							// 	uni.showToast({
							// 		icon: 'none',
							// 		title: '此资产已被抵押，请重新录入',
							// 		duration: 2000
							// 	})
							// 	this.stdOffsurCollateral04[index].certificateCode = ''
							// 	this.stdOffsurCollateral04[index].mortgageSystemId = ''
							// }
						} else {
							uni.showToast({
								icon: 'none',
								title: '校验失败，请重试！',
								duration: 2000
							})
						}
					}
				})
			},
			wyjy(item, index) {
				if (!item.certificateCode) {
					uni.showToast({
						icon: 'none',
						title: '请输入产权证号！',
						duration: 2000
					})
					return false
				}
				//接口评估房产
				let data = {
					collatName: '',
					"idnfNo": item.certificateCode,
					"collatType": item.collateralType,
					reqId: getApp().globalData.stdOffsurBaiscInfo.reqId
				}
				this.sendRequest({
					url: 'loanBaseInfo/collateralIsUnique',
					method: 'post',
					hideLoading: true,
					data: data,
					complete: (res) => {
						if (res.code == '200') {
							if (res.data.EXST_STATUS == '0') {
								uni.showToast({
									icon: 'none',
									title: '验证通过',
									duration: 2000
								})
							} else {
								uni.showToast({
									icon: 'none',
									title: '押品系统已存在该押品，请注意核对！',
									duration: 2000
								})
							}
							this.stdOffsurCollateral03[index].mortgageSystemId = res.data.COLL_REF
							// } else {
							// 	uni.showToast({
							// 		icon: 'none',
							// 		title: '此资产已被抵押，请重新录入',
							// 		duration: 2000
							// 	})
							// 	this.stdOffsurCollateral03[index].certificateCode = ''
							// 	this.stdOffsurCollateral03[index].mortgageSystemId = ''
							// }
						} else {
							uni.showToast({
								icon: 'none',
								title: '校验失败，请重试！',
								duration: 2000
							})
						}
					}
				})
			},
			pg(item, index) {
				//接口评估房产
				let arr = item.mortgageAdd.split(',')
				let data = {
					"areaId": arr[2],
					"buildingName": item.buildingNo,
					"cityId": arr[1],
					"floor": item.floor,
					"houseName": item.roomNo,
					"projectName": item.buildingName,
					buildArea: item.area,
					projectId: item.projectId,
					buildingId: item.buildingId,
					houseId: item.buildingId
				}
				this.sendRequest({
					url: 'fxt/enquiry',
					method: 'post',
					hideLoading: true,
					data: data,
					complete: (res) => {
						if (res.code == '0') {
							item.autoAssessPrice = res.body.totalPrice
							item.manAssessPrice = ''
						} else {
							uni.showToast({
								icon: 'none',
								title: res.message || "评估失败",
								duration: 2000
							})
						}
					}
				})
			},
			pledgorTypeChange(zitem, index) {
				if (zitem.pledgorType == '1') {
					zitem.idenType = '110000'
				} else if (zitem.pledgorType == '2') {
					zitem.idenType = '610003'
				}
			},
			add() {
				let obj = {
				    mortgageCalculAmount:'',
					mortagageCount: '', //抵押次数
					pledgeType: '房地产', //押品名称
					certificateIdent: 'Y',
					mortgageSystemId: '',
					firstMortgage: '',
					allFloor: '', //总层数
					area: '', //面积
					autoAssessPrice: '', //系统评估价值
					buildingNo: '',
					buildingAttr: "", //房产性质
					buildingName: "", //楼盘名称
					busiType: "03", //业务类型
					businessId: "", //业务申请流水号
					certificateAdd: '', //房产证地址
					certificateCode: "", //房产证号码
					certificateEndDate: "", //土地使用权终止日期
					certificateRegDate: "", //房屋产权登记日期
					collateralType: "C1101", //押品类型
					consignor: "", //委托人
					consignorPhone: "", //委托人电话
					createTime: "", //创建时间
					createUser: "", //创建人
					customerId: "", //客户编号
					customerSystemId: "", //客户系统编号
					deleteFlag: "", //删除标志
					entId: "", //企业ID
					entityRoleType: "", //数据归属类型
					fixStatus: "", //装修状态
					floor: '', //所在楼层
					getDatTime: "", //数据加载时间
					guaranteeBalance: '', //担保余额（元）
					idCode: "", //证件号码
					imageUrl: "", //影像路径
					manAssessPrice: '', //人工评估（抵押、质押）价值
					mortgageAdd: '', //抵押物所在地区
					obligeeName: "", //权利人名称
					obligeeNameList: [{
						idenCode: '', //证件号码
						idenType: '', //证件类型
						pledgorIdenAtt: '', //抵押人身份属性
						pledgorName: '', //抵押人名称
						pledgorType: '', //抵押人类型
						postCode: '', //邮政编码
						residence: '', //住所
						telephone: '', //联系电话
						tranAdd: '' //通讯地址
					}, ], //多个权利人名称
					pledgeDetail: "", //质押物的具体描述
					reqId: "", //业务申请序号
					residue: '', //剩余价值
					roomNo: '',
					sourceSystem: "", //数据来源系统
					updateTime: "", //更新时间
					updateUser: "", //更新人
					uuid: "", //uuid
					xh: "" //总层数
				}
				if(this.loanType==='4'){
					obj.firstMortgage = '01'
					obj.guaranteeBalance = '0'
					obj.obligeeNameList = [{
						idenCode: '', //证件号码
						idenType: '110000', //证件类型
						pledgorIdenAtt: '', //抵押人身份属性
						pledgorName: '', //抵押人名称
						pledgorType: '1', //抵押人类型
						postCode: '', //邮政编码
						residence: '', //住所
						telephone: '', //联系电话
						tranAdd: '' //通讯地址
					}]
				}
				this.stdOffsurCollateral03.push(obj)
			},
			add2() {
				let obj = {
					mortgageCalculAmount:'',
					certificateEndDate: "", //土地使用权终止日期
					certificateRegDate: "", //房屋产权登记日期
					mortagageCount: '', //抵押次数
					cardTypeList: [],
					disabled1: false,
					disabled2: false,
					disabled3: false,
					certificateIdent: 'N',
					idnfName: '',
					collateralTypeName: '',
					pledgeType: '', //押品名称
					mortgageSystemId: '', //押品编号
					certificateCode: '', //唯一编号
					located: '', //地址坐落
					unit: '', //单位
					area: '', //数量面积
					guaranteeType: '', //担保方式
					firstMortgage: '', //是否第一顺位抵押
					busiType: "03", //业务类型
					businessId: "", //业务申请流水号
					collateralType: "", //押品类型				
					manAssessPrice: '', //人工评估（抵押、质押）价值
					pledgeDetail: "", //押物的具体描述
					residue: '', //剩余价值
					xh: "", //
					obligeeName: "", //权利人名称
					obligeeNameList: [{
						idenCode: '', //证件号码
						idenType: '', //证件类型
						pledgorIdenAtt: '', //抵押人身份属性
						pledgorName: '', //抵押人名称
						pledgorType: '', //抵押人类型
						postCode: '', //邮政编码
						residence: '', //住所
						telephone: '', //联系电话
						tranAdd: '' //通讯地址
					}], //多个权利人名称
				}
				if(this.loanType==='4'){
					obj.firstMortgage = '01'
					obj.guaranteeBalance = '0'
					obj.obligeeNameList = [{
						idenCode: '', //证件号码
						idenType: '110000', //证件类型
						pledgorIdenAtt: '', //抵押人身份属性
						pledgorName: '', //抵押人名称
						pledgorType: '1', //抵押人类型
						postCode: '', //邮政编码
						residence: '', //住所
						telephone: '', //联系电话
						tranAdd: '' //通讯地址
					}]
				}
				this.stdOffsurCollateral04.push(obj)
			},
			addUser(index) {
				let obj = {
					frName: '', //faren 
					idenCode: '', //证件号码
					idenType: '', //证件类型
					pledgorIdenAtt: '', //抵押人身份属性
					pledgorName: '', //抵押人名称
					pledgorType: '', //抵押人类型
					postCode: '', //邮政编码
					residence: '', //住所
					telephone: '', //联系电话
					tranAdd: '', //通讯地址
					maritalBelongPledgor: '',
					maritalBelongCollater: ''
				}
				if(this.loanType==='4'){
					obj.pledgorType = '1'
					obj.idenType = '110000'
				}
				this.stdOffsurCollateral03[index].obligeeNameList.push(obj)
			},
			addUserA(index) {
				let arr = this.stdOffsurCollateral03[index].obligeeNameList
				let data = {
					frName: '', //faren 
					idenCode: getApp().globalData.stdOffsurIndBasic.idCode, //证件号码
					idenType: '110000', //证件类型
					pledgorIdenAtt: '', //抵押人身份属性
					pledgorName: getApp().globalData.stdOffsurIndBasic.custName, //抵押人名称
					pledgorType: '1', //抵押人类型
					postCode: '', //邮政编码
					residence: '', //住所
					telephone: getApp().globalData.stdOffsurIndBasic.telephone, //联系电话
					tranAdd: getApp().globalData.stdOffsurIndBasic.addDetail //通讯地址
				}
				for (let i = 0; i < arr.length; i++) {
					if (arr[i].idenCode == getApp().globalData.stdOffsurIndBasic.idCode) {
						uni.showToast({
							icon: 'none',
							title: '此人已录入！',
							duration: 2500
						});
						return false
					}
				}
				this.stdOffsurCollateral03[index].obligeeNameList.push(data)
			},
			
			addUserC(index) {
				let arr = this.stdOffsurCollateral03[index].obligeeNameList
				let data = {
					frName: getApp().globalData.stdOffsurEntBasic.frName, //faren 
					idenCode: getApp().globalData.stdOffsurEntBasic.creditCode, //证件号码
					idenType: '610003', //证件类型
					pledgorIdenAtt: '', //抵押人身份属性
					pledgorName: getApp().globalData.stdOffsurEntBasic.entName, //抵押人名称
					pledgorType: '2', //抵押人类型
					postCode: '', //邮政编码
					residence: '', //住所
					telephone: '', //联系电话
					tranAdd: '' //通讯地址
				}
				if (!getApp().globalData.stdOffsurEntBasic.entName) {
					uni.showToast({
						icon: 'none',
						title: '请补全企业基本信息！',
						duration: 2500
					});
					return false
				}
				for (let i = 0; i < arr.length; i++) {
					if (arr[i].idenCode == getApp().globalData.stdOffsurEntBasic.creditCode) {
						uni.showToast({
							icon: 'none',
							title: '此人已录入！',
							duration: 2500
						});
						return false
					}
				}
				this.stdOffsurCollateral03[index].obligeeNameList.push(data)
			},
			addUser2(index) {
				let obj = {
					frName: '', //faren 
					idenCode: '', //证件号码
					idenType: '', //证件类型
					pledgorIdenAtt: '', //抵押人身份属性
					pledgorName: '', //抵押人名称
					pledgorType: '', //抵押人类型
					postCode: '', //邮政编码
					residence: '', //住所
					telephone: '', //联系电话
					tranAdd: '', //通讯地址
					maritalBelongPledgor: '',
					maritalBelongCollater: ''
				}
				if(this.loanType==='4'){
					obj.pledgorType = '1'
					obj.idenType = '110000'
				}
				this.stdOffsurCollateral04[index].obligeeNameList.push(obj)
				
			},
			addUserD(index) {
				let arr = this.stdOffsurCollateral04[index].obligeeNameList
				let data = {
					frName: '', //faren 
					idenCode: getApp().globalData.stdOffsurIndBasic.idCode, //证件号码
					idenType: '110000', //证件类型
					pledgorIdenAtt: '', //抵押人身份属性
					pledgorName: getApp().globalData.stdOffsurIndBasic.custName, //抵押人名称
					pledgorType: '1', //抵押人类型
					postCode: '', //邮政编码
					residence: '', //住所
					telephone: getApp().globalData.stdOffsurIndBasic.telephone, //联系电话
					tranAdd: getApp().globalData.stdOffsurIndBasic.addDetail //通讯地址
				}
				for (let i = 0; i < arr.length; i++) {
					if (arr[i].idenCode == getApp().globalData.stdOffsurIndBasic.idCode) {
						uni.showToast({
							icon: 'none',
							title: '此人已录入！',
							duration: 2500
						});
						return false
					}
				}
				this.stdOffsurCollateral04[index].obligeeNameList.push(data)
			},
			addUserF(index) {
				let arr = this.stdOffsurCollateral04[index].obligeeNameList
				let data = {
					frName: getApp().globalData.stdOffsurEntBasic.frName, //faren 
					idenCode: getApp().globalData.stdOffsurEntBasic.creditCode, //证件号码
					idenType: '610003', //证件类型
					pledgorIdenAtt: '', //抵押人身份属性
					pledgorName: getApp().globalData.stdOffsurEntBasic.entName, //抵押人名称
					pledgorType: '2', //抵押人类型
					postCode: '', //邮政编码
					residence: '', //住所
					telephone: '', //联系电话
					tranAdd: '' //通讯地址
				}
				if (!getApp().globalData.stdOffsurEntBasic.entName) {
					uni.showToast({
						icon: 'none',
						title: '请补全企业基本信息！',
						duration: 2500
					});
					return false
				}
				for (let i = 0; i < arr.length; i++) {
					if (arr[i].idenCode == getApp().globalData.stdOffsurEntBasic.creditCode) {
						uni.showToast({
							icon: 'none',
							title: '此人已录入！',
							duration: 2500
						});
						return false
					}
				}
				this.stdOffsurCollateral04[index].obligeeNameList.push(data)
			},
		}
	}
</script>
<style lang="scss">
</style>
